package com.nongtai.controller;

import com.nongtai.pojo.dto.UserLoginDto;
import com.nongtai.result.Result;
import com.nongtai.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户相关
 * @author yza
 * @version 1.0
 * @date 2024/7/11 16:37
 */
@RestController
@Slf4j
public class UserController {
    @Resource
    private UserService userService;

    /**
     * 用户登录
     * @param user
     * @return
     */
    @PostMapping("/login")
    public Result doLogin(@RequestBody UserLoginDto user){
        return userService.doLogin(user);
    }

}
